package top.hekun.study.reptile.util;

import top.hekun.study.reptile.model.ByteBufferProxy;

import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * ByteBuffer 工具类
 * @Author: 贺坤
 * @Date: 2023/4/23 15:09
 */
public class ByteBufferUtil {
    /**
     * 根据缓冲区大小获取 ByteBuffer
     * @param capacity
     * @return
     */
    public static ByteBufferProxy getByteBufferProxy(int capacity) {
        ByteBuffer allocate = ByteBuffer.allocate(capacity);

        return new ByteBufferProxy(allocate);
    }



}
